import { debounce } from "components/common/utils"
import BackTop from "components/content/backTop/BackTop.vue";
export const itemListenerMixin = {
    data() {
        return {
            itemImageListener: null
        }
    },
    mounted() {
        const refresh = debounce(this.$refs.scroll.refresh, 100);
        this.itemImageListener = () => { refresh() }
        this.$bus.$on("itemImageLoad", this.itemImageListener)
        console.log("inner Mixin")
    }
}

export const backTopMinin = {
    components: {
        BackTop
    },
    data() {
        return {
            isShow: true,
        }
    },
    methods: {
        backClick() {
            this.$refs.scroll.scrollTo(0, 0, 300);
        },
        demo(position) {
            this.isShow = -position.y > 1000;
        },
    }
}